<?php
/**
 * Module Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_product_listing.php 3241 2006-03-22 04:27:27Z ajeh $
 */
 include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCT_LISTING));
?>
<div id="productListing">
<?php
// only show when there is something to submit and enabled
    if ($show_top_submit_button == true) {
?>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit1" name="submit1"'); ?></div>
<br class="clearBoth" />
<?php
    } // show top submit
?>
<?php 
if (isset($the_options_values_choosed)&&isset($_GET_options_values_id)&&!empty($the_options_values_choosed)){
	echo '<div class="product_list_options_nav"><label class="product_list_options_nav_title">Your Selections:</label>';
	foreach ($the_options_values_choosed as $v){
		$str = implode('_',array_diff ($_GET_options_values_id,array($v['products_options_values_id'])));
		$str = empty($str)?'':'options_values_id='.$str;
		echo '<span class="product_list_options_option"><a href="'.zen_href_link(FILENAME_DEFAULT,$fn_zen_href_link_parameters2.$str).'">'.$v['products_options_name'].'</a></span>';
	}
	echo '</div>';
}
?>
<?php if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<div id="productsListTopPageNav">
<?php require DIR_WS_MODULES.zen_get_module_directory('products_list_page_navigation.php'); ?>
</div>
<?php
}
?>
<div class="products_list_bar">
	<ul>
		<li>View:</li>
		<?php 
		$view_style_array = array('list','gric','gallery');
		foreach ($view_style_array as $style){
			if ($view_style==$style){
		?>
			<li><span class="list_<?php echo $style?>_active"><?php echo $style?></span></li>
		<?php		
			}else{
				$parameters = zen_get_all_get_params(array('view_style','info', 'x', 'y'));
		?>
			<li><a href="<?php echo zen_href_link($_GET['main_page'], $parameters.'&view_style='.$style)?>" class="list_<?php echo $style?>"><?php echo $style?></a></li>
		<?php		
			}
		}
		?>
	</ul>
</div>
<br class="clearBoth" />
<?php
/**
 * load the list_box_content template to display the products
 */
if ($view_style=='list')
	require $template->get_template_dir('tpl_tabular_display_products_list.php',DIR_WS_TEMPLATE,$current_page_base, 'templates'). '/tpl_tabular_display_products_list.php';
elseif ($view_style=='gric')
  require $template->get_template_dir('tpl_columnar_display_products_gric.php',DIR_WS_TEMPLATE,$current_page_base, 'templates'). '/tpl_columnar_display_products_gric.php';
else
	require $template->get_template_dir('tpl_columnar_display_products_gallery.php',DIR_WS_TEMPLATE,$current_page_base, 'templates'). '/tpl_columnar_display_products_gallery.php';
?>

<?php if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<div id="productsListBottomPageNav">
<?php require DIR_WS_MODULES.zen_get_module_directory('products_list_page_navigation.php'); ?>
</div>
<?php
  }
?>
<?php
// only show when there is something to submit and enabled
    if ($show_bottom_submit_button == true) {
?>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit2" name="submit1"'); ?></div>
<br class="clearBoth" />
<?php
    } // show_bottom_submit_button
?>
</div>

<?php
// if ($show_top_submit_button == true or $show_bottom_submit_button == true or (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0)) {
  if ($show_top_submit_button == true or $show_bottom_submit_button == true) {
?>
</form>
<?php } ?>
